﻿using SD.Infrastructure.WPF.Caliburn.Base;
using System.Collections.ObjectModel;
using System.Threading.Tasks;

namespace SlamDunk.MES.Client.ViewModels.Supervision
{
    /// <summary>
    /// 设备监控信息查看ViewModel
    /// </summary>
    public class LookViewModel : ScreenBase
    {
        #region # 字段及构造器

        /// <summary>
        /// 依赖注入构造器
        /// </summary>
        public LookViewModel()
        {
        }

        #endregion

        #region 属性
        public ObservableCollection<SupervisionInfo> SupervisionList { get; set; }
        #endregion

        #region 方法
        #region 加载 —— async Task Load()
        /// <summary>
        /// 加载
        /// </summary>
        public async Task Load()
        {
            SupervisionList = new ObservableCollection<SupervisionInfo>();
            SupervisionList.Add(new SupervisionInfo()
            {
                PointPositionName = "门区温度",
                SetUpValue = "40℃",
                EarlyWarningValue = "45℃",
                ActualValue = "40℃"
            });
            SupervisionList.Add(new SupervisionInfo()
            {
                PointPositionName = "中区温度",
                SetUpValue = "40℃",
                EarlyWarningValue = "45℃",
                ActualValue = "41℃"
            });
            SupervisionList.Add(new SupervisionInfo()
            {
                PointPositionName = "里区温度",
                SetUpValue = "40℃",
                EarlyWarningValue = "45℃",
                ActualValue = "41℃"
            });
            SupervisionList.Add(new SupervisionInfo()
            {
                PointPositionName = "运行时长",
                SetUpValue = "2880分钟",
                EarlyWarningValue = "无",
                ActualValue = "2000分钟"
            });
        }
        #endregion
        #endregion

        public class SupervisionInfo
        {
            /// <summary>
            /// 点位名称
            /// </summary>
            public string PointPositionName { get; set; }

            /// <summary>
            /// 设定值
            /// </summary>
            public string SetUpValue { get; set; }
            /// <summary>
            /// 预警值
            /// </summary>
            public string EarlyWarningValue { get; set; }
            /// <summary>
            /// 实际值
            /// </summary>
            public string ActualValue { get; set; }
        }
    }
}
